﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using ARSys.Communication;
using Wicresoft.Logger;

namespace Wicresoft.Task.Common
{
    public class ARSysWCF : HostTask
    {
        private ServiceHost host = new ServiceHost(typeof(EmailService));

        public override void OnStart()
        {
            if (host != null)
            {
                host.Open();
                Log.Info("WCF", "Host ARSysWCF has started.");
            }
        }

        public override void OnStop()
        {
            if (host != null)
            {
                host.Close();
                Log.Info("WCF", "Host ARSysWCF has stopped.");
            }
        }
    }
}
